#!/bin/sh

url="${1}"
shift 1

if [ -z "${url}" ]
then
    1>&2 echo "usage:"
    1>&2 echo "  ${0} <url> [<option>]"
    exit 1
fi

exec curl --silent --head "$url" | head -n 1 | grep ' 200\b' >/dev/null && echo "$url"
